package com.tz.aop.test.controller;

import com.tz.aop.test.entity.User;
import com.tz.aop.test.pojo.ApiResponseDTO;
import com.tz.aop.test.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api/user")
public class UserController {

    @Resource
    private UserService userService;

    @GetMapping("/getAllUser")
    public ApiResponseDTO getAllUser() {
        List<User> allUser = userService.getAllUser();
        return new ApiResponseDTO(allUser);
    }

}
